package com.yimi.yinhepda.views.dispatch_module;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import butterknife.Bind;
import com.yimi.yinhepda.R;
import com.yimi.yinhepda.base.BaseInitActivity;

/**
 * @author 000432
 * @date 2017/4/23 0023
 * 配送完成页面
 */
public class DispatchSuccessActivity extends BaseInitActivity {
  /** 标题栏左边 */
  @Bind(R.id.title) TextView mTvTitle;
  /** 标题栏中间 */
  @Bind(R.id.num) TextView mTvNum;
  @Bind(R.id.activity_load_success_carcode) EditText mEtTaskNo;
  @Bind(R.id.activity_load_success_src) EditText mEtBigArea;
  @Bind(R.id.activity_load_success_carno) EditText mEtCarNo;
  @Bind(R.id.activity_load_success_realweight) EditText mEtRealWeight;
  @Bind(R.id.activity_load_success_checkweight) EditText mEtChargeWeight;
  @Bind(R.id.activity_load_success_btn) Button mBtnSuccess;

  private String mTaskNo;
  private String mBigArea;
  private String mCarNo;
  private String mRealWeight;
  private String mChargeWeight;
  private int totalNotUploadNum;

  @Override public String getPageName() {
    return getString(R.string.page_dispatch_success);
  }

  @Override public int getContentViewId() {
    return R.layout.activity_dispatch_success;
  }

  @Override public void initView(Bundle savedInstanceState) {
    mTaskNo = getIntent().getStringExtra("taskno");
    mBigArea = getIntent().getStringExtra("bigArea");
    mCarNo = getIntent().getStringExtra("carno");
    mRealWeight = getIntent().getStringExtra("realWeight");
    mChargeWeight = getIntent().getStringExtra("chargeWeight");
    totalNotUploadNum = getIntent().getIntExtra("totalNotUploadNum", 0);
    mTvTitle.setText(getString(R.string.page_dispatch_success));
    mTvNum.setText(totalNotUploadNum + "");
  }

  @Override public void initEvent() {
    mBtnSuccess.setOnClickListener(new View.OnClickListener() {
      @Override public void onClick(View view) {
        finish();
      }
    });
  }

  @Override public void initData() {
    mEtTaskNo.setText(mTaskNo);
    mEtBigArea.setText(mBigArea);
    mEtCarNo.setText(mCarNo);
    mEtRealWeight.setText(mRealWeight);
    mEtChargeWeight.setText(mChargeWeight);
  }
}
